package org.example.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.pojo.DApplyApartment;
import org.example.pojo.select.DApplyApartmentSelect;
import org.example.service.DApplyApartmentService;
import org.example.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("applyApartment")
@Tag(name = "(废弃API)DApplyApartmentController",description = "")
public class DApplyApartmentController {

    @Autowired
    private DApplyApartmentService dApplyApartmentService;

    @PostMapping("/selectAll")
    public Result<Map> selectAll(@RequestBody DApplyApartmentSelect dApplyApartmentSelect){
        return dApplyApartmentService.SelectAllApplyApartment(dApplyApartmentSelect);
    }

    @PostMapping("/updateStatus")
    public Result<DApplyApartment> UpdateStatus(@RequestBody DApplyApartment dApplyApartment){
        return dApplyApartmentService.updateStatusApplyApartment(dApplyApartment);
    }

    @PostMapping("/confirmApartment")
    public Result<DApplyApartment> ConfirmApartment(@RequestBody DApplyApartment dApplyApartment){
        return dApplyApartmentService.ConfirmApartment(dApplyApartment);
    }

    @PostMapping("/addApply")
    public Result<DApplyApartmentSelect> AddApply(@RequestBody DApplyApartmentSelect dApplyApartmentSelect){
        return dApplyApartmentService.AddApply(dApplyApartmentSelect);
    }
}
